<div id="tabs">
	<ul>
        <li><?php echo $this->Html->link(__('Báo cáo ngày', true),  array('controller'=>'kqbanhangs','action'=>'kqbhngaytt',$this->Session->read('cur_dv')));?></li>
        <li  id="current"><?php echo $this->Html->link(__('Báo cáo tuần', true), array('controller'=>'kqbanhangs','action'=>'kqbhtuantt',$this->Session->read('cur_dv')));?></li>
        <li><?php echo $this->Html->link(__('Báo cáo tháng', true),  array('controller'=>'kqbanhangs','action'=>'kqbhthangtt',$this->Session->read('cur_dv')));?></li>
	   <li><?php echo $this->Html->link(__('Lũy kế tổng hợp', true),  array('controller'=>'kqbanhangs','action'=>'luyketonghop',$this->Session->read('cur_dv')));?></li>
    </ul>
</div>
<?php echo $form->create('Kqbanhang');?>
<h2>Vui lòng chọn Tuần muốn xem tổng kết quả bán hàng của tất cả Nhân viên thuộc đơn vị</h2>
<table>
<tr>
<td>
<?php
	if(empty($nams))
		$nams =array(); 
echo $form->input('nam',array('id'=>'nam','label'=>'Năm','options'=>$nams,'empty'=>"Chọn Năm",'selected'=>date('Y')));?>
</td>
<td width=100>
<div id='thang'>
<?php echo $form->input('thang',array('id'=>'thang','label'=>'Tháng','options'=>$thoigian,'empty'=>"Chọn Tháng"));?>
</div>
</td>
<td>
<div  id='tuan'>
<?php echo $form->input('thoigian_id',array('id'=>'tuan','label'=>'Tuần','options'=>array(),'empty'=>"Chọn Tuần"));?>
</div>
</td>


<td>
<?php 
echo $js->submit('Xem', array(
								'url'=> array('controller'=>'kqbanhangs', 'action'=>'laykqbhtt',$dv_id),
 								'update' => '#kq'));
?>
</td>
</tr>
</table>
<div  id='kq'></div>
<?php
$this->Js->get('#nam')->event('change',
								$this->Js->request(array('controller' => 'kqbanhangs', 'action' => 'laythangtt',$dv_id),
								array('update' => '#thang','async' => true,
								'dataExpression' => true,'method' => 'post',
								'data' => $js->serializeForm(array('isForm' => false, 'inline' => true,'thang')))));
$this->Js->get('#nam')->event('change',
								$this->Js->request(array('controller' => 'kqbanhangs', 'action' => 'emptytuan'),
								array('update' => '#tuan','async' => true,
								'dataExpression' => true,'method' => 'post',
								'data' => $js->serializeForm(array('isForm' => false, 'inline' => true,'thang')))));

$this->Js->get('#nam')->event('change',
								$this->Js->request(array('controller' => 'kqbanhangs', 'action' => 'emptykq'),
								array('update' => '#kq','async' => true,
								'dataExpression' => true,'method' => 'post',
								'data' => $js->serializeForm(array('isForm' => false, 'inline' => true,'thang')))));
								
$this->Js->get('#thang')->event('change',
								$this->Js->request(array('controller' => 'kqbanhangs', 'action' => 'laytuantt',$dv_id),
								array('update' => '#tuan','async' => true,
								'dataExpression' => true,'method' => 'post',
								'data' => $js->serializeForm(array('isForm' => false, 'inline' => true,'thang')))));
$this->Js->get('#thang')->event('change',
								$this->Js->request(array('controller' => 'kqbanhangs', 'action' => 'emptykq'),
								array('update' => '#kq','async' => true,
								'dataExpression' => true,'method' => 'post',
								'data' => $js->serializeForm(array('isForm' => false, 'inline' => true,'thang')))));
/*$this->Js->get('#tuan')->event('change',
								$this->Js->request(array('controller' => 'kqbanhangs', 'action' => 'laykqbhtt',$dv_id),
								array('update' => '#kq','async' => true,
								'dataExpression' => true,'method' => 'post',
								'data' => $js->serializeForm(array('isForm' => false, 'inline' => true)))));
*/
echo $form->end();
?>